package com.yc.springmvc.core;

import com.sun.org.apache.xml.internal.security.Init;

import java.util.Hashtable;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;

/**
 * @Auther: HuYang
 * @Date: 2022/11/1 - 11 - 01 - 14:49
 * @Description: com.yc.springmvc.core
 * @version: 1.0
 */
public class FrameworkCore {
    private String contextConfigLocation;//配置文件
    private String basePackage;//配置基址扫描路径
    private Set<String> className = new CopyOnWriteArraySet <String>();//放扫描得到的类包含这个类的全路径
    private Map<String,Object> instanceObjiect = new Hashtable<String,Object>();//存放Ioc容器实例化好的对象

    public FrameworkCore(String contextConfigLocation){
        this.contextConfigLocation = contextConfigLocation;
        init();//初始化方法
    }

    private void init() {
        //读取配置文件获取要扫描的基址路径
        doLoadConfig();
        //扫描包获取类路径
        doScannerPackage();
        //实例化对象,初始化Ioc容器
        doInstanceObjiect();
        //执行依赖注入
        doAutowired();

        //构建URL与方法直接的映射
        initHandLerMapper();

    }

    private void doAutowired() {
    }

    private void doInstanceObjiect() {
    }

    private void doScannerPackage() {
    }

    private void doLoadConfig() {
    }

    private void initHandLerMapper() {
    }
}
